{# Copyright 2010 Google Inc. All Rights Reserved. #}

{% comment %}
  UI for approving a migration. Accepts one argument, "migration",
  which is the migration to render controls for.

  Author: nicksantos@google.com (Nick Santos)
{% endcomment %}

{% if migration.IsPending %}
<div>
  <input type="submit" value="Approve this migration">
</div>
{% endif %}
</form>

{% if migration.IsApproved %}
<div>
<form action="/api/unapprove_migration?out=html" method="post">
  <input type="hidden"
        value="{{ migration.project.name }}" name="project_name">
  <input type="hidden"
         value="{{ migration.migration_id }}" name="migration_id">
  <input type="submit" value="Unapprove this migration">
</form>
</div>
{% endif %}

{% if not migration.IsCanceled %}
<div>
<form action="/api/cancel_migration?out=html" method="post">
  <input type="hidden"
        value="{{ migration.project.name }}" name="project_name">
  <input type="hidden"
         value="{{ migration.migration_id }}" name="migration_id">
  <input type="submit" value="Cancel this migration">
</form>
</div>

{% if not migration.IsSubmitted %}
<div>
<form action="/api/finish_migration?out=html" method="post">
  <input type="hidden"
        value="{{ migration.project.name }}" name="project_name">
  <input type="hidden"
         value="{{ migration.migration_id }}" name="migration_id">
  <input type="submit" value="Note finished migration"> <br>
  Submitted revision: <input type="text" name="submitted_as_id">
</form>
</div>
{% endif %}
{% endif %}
